#!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import zipfile


def ZipFolder(startdir,targetZipNamePrefix):
    targetZipFileName = targetZipNamePrefix+'.zip'
    z = zipfile.ZipFile(targetZipFileName, 'w', zipfile.ZIP_DEFLATED)
    for dirpath, dirnames, filenames in os.walk(startdir):
        for filename in filenames:
            z.write(os.path.join(dirpath, filename))
    z.close()
    return targetZipFileName
